#pragma once
#define _CRT_SECURE_NO_WARNINGS 1;
#include <iostream>
#include <assert.h>


namespace my_string
{
	class string
	{
	public:
		string(const char* str = "")
		{
			_size = strlen(str);
			_capacity = _size;
			_str = new char[_capacity + 1];
			strcpy(_str, str);
		}
		//s1(s2)
		string(const string& s)
		{
			_size = s._size;
			_capacity = s._capacity;
			_str = new char[_capacity + 1];
			strcpy(_str, s._str);
		}
		~string()
		{
			delete[] _str;
			_str = nullptr;
			_size = _capacity = 0;
		}
		const char* c_str()const
		{
			return this->_str;
		}
	private:
		char* _str;
		size_t _size;
		size_t _capacity;
	};
}
